<?php
namespace Admin\Model;//命名空间 防止重名
use Think\Model\ViewModel;//自动加载核心控制器类
class GoodsViewModel extends ViewModel {
    public $viewFields = array(
        'Goods' => array('id','title','img','market_price','category_id','shop_price','num','resolution','size','cell','c_time','u_time','_type'=>'LEFT'),
        'Category' => array('name','_on'=>'Goods.category_id = Category.id','_type'=>'LEFT'),
        'GoodsInfo' => array('more_img','content','_on'=>'Goods.id = GoodsInfo.goods_id')
    );
    public $viewFields_bf = array(
        'Goods' => array('_as'=>'g','id','title','img','category_id','market_price','shop_price','num','c_time','u_time','_type'=>'LEFT'),
        'Category' => array('_as'=>'c','name'=>'cate_name','_on'=>'g.category_id = c.id','_type'=>'LEFT'),
        'GoodsInfo' => array('_as'=>'gi','more_img','content','_on'=>'g.id = gi.goods_id')
    );
}